
!function proxyInit() {
    if (!(window && document)) 
        console.log('非浏览器环境');
        
    try {
        //  本地域
          //.domain = "qj.com";
        //  线上域
        document.domain = "allhome.com.cn";
    } catch(err) {}

    //  挂载代理
    Object.defineProperty(window, 'token', {
        get: function() {
            console.log(parent.window,'parent')
            return parent.window.globalToken;
        },
        set: function(val) {
            parent.window.globalToken = val;
        },
        configurable: true
    })
    //  挂载退出方法
    window.logout = function() {
        let {globalLogout} = parent.window;
        globalLogout && globalLogout();
    }
}()
